import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { MsgProvider } from '../../../providers/service/msg'
/**
 * Generated class for the MsgDetailPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@Component({
  selector: 'page-msg-detail',
  templateUrl: 'msg-detail.html',
})
export class MsgDetailPage {

  constructor(public navCtrl: NavController,
    public msgProvider: MsgProvider,
    public navParams: NavParams) {
  }

  isReady = false;
  isLoading = true;

  //消息id
  id;
  msgObj = null;
  ionViewDidLoad() {
    //console.log('ionViewDidLoad MsgDetailPage');
    this.isReady = true;
    this.id = this.navParams.data.id;
    this.isLoading = true;
    this.msgProvider.getMsgDetail(this.id).then(res=>{
        // console.log(res);
        this.msgObj = res;
        this.isLoading = false;
    }, err=>{
        this.isLoading = false;
    });
    

  }

}
